package net.betou.cms.manager.assist.impl;

import java.util.Date;

import net.betou.cms.dao.assist.CmsMessageDao;
import net.betou.cms.entity.assist.CmsMessage;
import net.betou.cms.manager.assist.CmsMessageMng;
import net.betou.common.hibernate3.Updater;
import net.betou.common.page.Pagination;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * 江西金磊科技发展有限公司jeecms研发
 */
@Service
@Transactional
public class CmsMessageMngImpl implements CmsMessageMng{

	public Pagination getPage( Integer siteId, Integer sendUserId, Integer receiverUserId, String title, Date sendBeginTime, Date sendEndTime, Boolean status, Integer box, Boolean cacheable, int pageNo, int pageSize ) {
		return dao.getPage( siteId, sendUserId, receiverUserId, title, sendBeginTime, sendEndTime, status, box, cacheable, pageNo, pageSize );
	}

	public CmsMessage findById( Integer id ) {
		return dao.findById( id );
	}

	public CmsMessage save( CmsMessage bean ) {
		return dao.save( bean );
	}

	public CmsMessage update( CmsMessage bean ) {
		Updater< CmsMessage > updater = new Updater< CmsMessage >( bean );
		bean = dao.updateByUpdater( updater );
		return bean;
	}

	public CmsMessage deleteById( Integer id ) {
		return dao.deleteById( id );
	}

	public CmsMessage [ ] deleteByIds( Integer [ ] ids ) {
		return dao.deleteByIds( ids );
	}

	@Autowired
	private CmsMessageDao dao;

}
